﻿using System;
using System.Collections.Generic;
using System.Linq;
using Subfaculty.Common.Interfaces;

namespace Subfaculty.WebApplication.Translators
{
	public abstract class BaseTranslator<TSource, TPe> : IBaseTranslator<TSource, TPe>
	{
		public virtual TPe Translate(TSource source)
		{
			throw new NotImplementedException("Translate");
		}

		public virtual IEnumerable<TPe> Translate(IEnumerable<TSource> sources)
		{
			return sources.Select(Translate);
		}

		public virtual TSource TranslateBack(TPe pe, TSource entity)
		{
			throw new NotSupportedException();
		}
	}
}